<template>
	<view>
		
		<view>
			<view class="row">
				
				<view style="flex: 1;">班级：{{detail.className}}</view>
				<view  style="flex: 1;">宿舍：{{detail.dormitoryNo}}</view>
			</view>
			<view class="row">
				
				<view style="flex: 1;">姓名：{{studentName}}</view>
				<view  style="flex: 1;">晚归次数：{{obj.laterReturn}}</view>
			</view>
			<view class="row">
				<view  style="flex: 1;">未归寝次数：{{obj.notReturn}}</view>
				<view  style="flex: 1;">请假次数：{{obj.leave}}</view>
			</view>
			
			
			<view style="background-color: #e9e9e9;height: 3rpx;"></view>
			
			<view class="row" style="font-weight: bold;">
				<view>状态</view>
				<view>日期</view>
			</view>
			<view class="row"    v-for="(item,index) in obj.stuUnusualAttenceList">
				<view>{{item.attenceStatus | status}}</view>
				<view>{{item.accessDate}}</view>
			</view>
			
			
			
			
		</view>
		
	</view>
</template>

<script>
	import topCom from '../component/topCom.vue'
	import bottomCom from '../component/bottom.vue'
	import headTitle from '../component/btnHeadeCom.vue'
	export default {
		data() {

			return {
				
				userName: '',
				topName: '值班数据',
				studentNo:'',
				studentName:'',
				obj:{},
				detail:{}

			}
		},
		components: {
			topCom,
			bottomCom,
			headTitle
		},
		filters: {
			status(data){
				// console.log(data)
				if(data==1){
					return "正常"
				}else if(data==2){
					return "未归寝"
				}else if(data==3){
					return "晚归"
				}else if(data==4){
					return "请假"
				}
			}
		},

		async onLoad(options) {
			var obj = JSON.parse(options.str);
			
			console.log(obj)
			this.detail = obj;
			this.studentNo = obj.studentNo;
			this.studentName = obj.studentName;
			var that = this
			uni.getStorage({
				key: "loginName",
				success: (res) => {
					that.userName = res.data
				}
			})

			
			uni.request({
				url: uni.url + 'Dorm/findAttencedByStuNo/'+this.studentNo,
				success: res => {
					// console.log(res.data.data);
					this.obj = res.data.data;
				}
			})


		},
		methods: {
			
			

		},

	}
</script>

<style lang="scss">
	*{
		color: #515c6f;
	}
	// .choose-type /deep/ .uniui-clear{
	// 	color: white !important;
	// }
	/deep/ .uni-select {
		border: unset;
		padding: 20rpx 20rpx 0 50rpx;
	}

	.mainContentWrap {

		border-bottom: #e9e9ee solid 1rpx;
		height: 70rpx;
		border-radius: 5rpx;
		// margin-top: 10rpx;
		width: 86%;
		margin: 0 auto;
		margin-left: 22rpx;
		// box-shadow: 0upx 0upx 3upx 0upx #8F8F94;
		display: flex;
		justify-content: space-between;
		align-content: space-around;
		align-items: center;

	}

	.row {
		display: flex;
		justify-content: space-around;
		padding: 10rpx 30rpx;

	}

	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	

	


	.indexContent {
		height: 100vh
	}

	.indexContent2 {
		height: 100vh !important
	}
	
	.row {
		display: flex;
		// border-top: 1rpx solid rgba(0, 0, 0, 0.1);
		margin: 0 30rpx;
	
		:nth-child(1) {
			flex: 1;
			margin: 30rpx;
	
		}
		:nth-child(2) {
			flex: 2;
			margin: 30rpx;
			
		}
	
	}
</style>
